package com.teach.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.teach.entity.CertificateType;
import com.teach.mapper.CertificateTypeMapper;
import com.teach.service.CertificateTypeService;

@Service
public class CertificateTypeServiceImpl implements CertificateTypeService{

	@Autowired
	private CertificateTypeMapper mapper;
	
	@Override
	public List<CertificateType> listAll() {
		return mapper.select();
	}

	@Override
	public CertificateType get(Long typeId) {
		return mapper.selectByPrimaryKey(typeId);
	}

	@Override
	public void add(CertificateType certificateType) {
		mapper.insertSelective(certificateType);
	}

	@Override
	public void update(CertificateType certificateType) {
		mapper.updateByPrimaryKeySelective(certificateType);
	}

	@Override
	public void delect(Long typeId) {
		mapper.deleteByPrimaryKey(typeId);
	}

}
